import 'package:trip_app/model/common_model.dart';
import 'package:trip_app/model/config_model.dart';
import 'package:trip_app/model/grid_nav_model.dart';
import 'package:trip_app/model/sales_box_model.dart';

class HomeModel{
  final List<CommonModel> bannerList;
  final List<CommonModel> localNavList;
  final List<CommonModel> subNavList;
  final ConfigModel config;
  final GridNavModel gridNav;
  final SalesBoxModel salesBox;

  HomeModel({this.config, this.bannerList, this.localNavList,this.subNavList, this.gridNav,this.salesBox});

  factory HomeModel.fromJson(Map<String,dynamic> json){
    var localNaListJson=json['localNavList'] as List;
    List<CommonModel> localNavList=localNaListJson.map((i) => CommonModel.fromJson(i)).toList();

    var bannerListJson=json['bannerList'] as List;
    List<CommonModel> bannerList=bannerListJson.map((i) => CommonModel.fromJson(i)).toList();

    var subNavListJson=json['subNavList'] as List;
    List<CommonModel> subNavList=subNavListJson.map((i) => CommonModel.fromJson(i)).toList();


    return HomeModel(
      localNavList: localNavList,
      bannerList: bannerList,
      subNavList: subNavList,
      config: ConfigModel.fromJson(json['config']),
      gridNav: GridNavModel.fromJson(json['gridNav']),
      salesBox: SalesBoxModel.fromJson(json['salesBox']),
    );
  }
}

